<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>04-原型constructor</title>
</head>

<body>
    <script>
        /* 
            显式/隐式原型都有一个属性 constructor 属性
            constructor 我们称为构造函数，因为它指向构造函数本身
            说明了对象是如何被创建的
        */
        function Star(name, age) {
            this.name = name;
            this.age = age;
        }
        let eason = new Star("eason", 22);
        console.log(eason.constructor);

        console.log(eason.__proto__);  // object
        console.log(eason.__proto__.constructor === Star);  // true
        console.log(eason.constructor === Star);  // true
    </script>
</body>

</html>